<?php  
    
    class Autoload{
        public function __construct() {
            spl_autoload_register(array($this, 'loader'));
        }
        private function loader($className) {
            $possibilities = array(
		            "../classes/" . $className . ".php",
		            "../../classes/" . $className . ".php",
		            "../../../classes/" . $className . ".php",
		            $className . '.php'
		        );
		        foreach ($possibilities as $file) {
		            if (file_exists($file)) {
		                require_once($file);
		                return true;
		            }
		        }
		        return false;
        }
    }

    $autoloader = new Autoload();
?>
